package dao

import (
	"golang-websocket-chatroom/global"
	"golang-websocket-chatroom/internal/model"
)

func GetByNameAndPassword(username, password string) model.User {
	var result model.User
	if err := global.DB.Where("username = ? and password = ?", username, password).Find(&result); err != nil {
		return model.User{}
	}
	return result
}
